<template>
  <div>
    <table-ext :columns="columns" :config="config" ref="tableExt">
    </table-ext>

  </div>
</template>
<script>
  import TableExt from '@/components/common/table-ext/table-ext.vue';
  import TableIcon from '@/components/common/table-ext/table-icon';
  export default {
    // 引入自定义表格组件
    components: {
      'table-ext': TableExt
    },
    data() {
      return {
        config: { // 页面共通配置
          title: '未报价', //页面标题
          isPage: true, //是否分页
          isNo: false, //是否显示序号
          selection: false, //是否显示复选框
          crudMapping: { // CRUD方法
            query: {
              url: this.lib.config.host.rfq + '/ctmgt/rfq/enquiry/compare/toquote/' + this.$route.query.id
            }
          }
        },
        // 查询表单配置
        // searchForm: [],
        // 表格列定义
        columns: [
          {
            label: '采购组织',
            key: 'purOrgName',
            align: 'center',
          }, {
            label: '物料编码',
            key: 'materialCode',
            align: 'center',
          },
          {
            label: '物料名称',
            key: 'materialName',
            align: 'center',
          }, {
            label: '供应商编码',
            key: 'vendorCode',
            align: 'center',
          }, {
            label: '供应商名称',
            key: 'vendorName',
            align: 'center',
          }, {
            label: '报价截止时间',
            key: 'quoLimitTime',
            align: 'center',
          }, {
            label: '是否放弃',
            key: 'giveUpStatus',
            align: 'center',
          render: (createElement, params) => { //动态渲染, 字典表示例
            return createElement(TableIcon, {
              props: {
                flag: params.row.giveUpStatus,
                titles: [{
                  status: 0,
                  title: '未放弃'
                }, {
                  status: 1,
                  title: '已放弃'
                }]
              }
            });
          }           
          }, {
            label: '放弃报价原因',
            key: 'giveUpReason',
            align: 'center',
          }
        ]
      };
    },
    methods: {

    }
  }

</script>
